package data;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;
import java.util.List;

import com.fasterxml.jackson.databind.ObjectMapper;

import jms.JmsProducer;
import jms.connection.JmsConnection;
import pojo.Book;

public class DataLoad {
	
private final static String FILENAME="D:\\data\\book.m";
	
	public List<Book> load(){
		ObjectInputStream obinInputStream = null;
		List<Book> books = new ArrayList<Book>();
		try {
			obinInputStream = new ObjectInputStream(new FileInputStream(FILENAME));
			books = (List<Book>) obinInputStream.readObject();
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}finally{
			try {
				obinInputStream.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
		return books;
	}
	
	

}
